
import java.util.LinkedList;
import java.util.Scanner;
public class Test {
    public static void main(String[] args) {
            Solution solution=new Solution();
            Solution.ListNode heda=new Solution.ListNode();
            heda.setVal(1);
           Solution.ListNode cur=new Solution.ListNode();
           cur.setVal(2);
            heda.next=cur;
            solution.isPalindrome(heda);
    }
    public static void main10(String args[]) {
        int [] arr1=new int[]{0,7,1,6};
        int [] arr2=new int[]{1,5,0,6};
        Gloves gloves=new Gloves();
        gloves.findMinimum(4,arr1,arr2);
    }

    public static void main9(String[] args) {
        System.out.println(new B().getValue());
    }

    static class A {
        protected int value;

        public A(int v) {
            setValue(v);
        }

        public void setValue(int value) {
            this.value = value;
        }

        public int getValue() {
            try {
                value++;
                return value;
            } catch (Exception e) {
                System.out.println(e.toString());
            } finally {
                setValue(value);
                System.out.println(value);
            }
            return value;
        }
    }

    static class B extends A {
        public B() {
            super(5);
            setValue(getValue() - 3);
        }

        public void setValue(int value) {
            super.setValue(2 * value);
        }
    }

    public static void main7(String[] args) {
        int[] nums=new int[]{-4,-1,-1,0,1,2};
        Solution solution=new Solution();
        solution.threeSum(nums);
    }
    public static void main6(String[] args) {
        int[][] people=new int[][]{{7,0},{4,4},{7,1},{5,0},{6,1},{5,2}};
        Solution solution=new Solution();
        solution.reconstructQueue(people);
        int [] arr=new int[]{10,9,2,5,3,7,101,18};
        solution.lengthOfLIS(arr);
    }
    public static void main5(String[] args) {
        String s= "af";
        String p= "be";
        Solution solution=new Solution();
        System.out.println("ab".equals("ba"));
        solution.findAnagrams(s,p);
        int[] arr=new int[]{1,2,3};
        int [] arr1=new int[]{1,2,3};
        System.out.println(arr.equals(arr1));
//        int len=s.length();
//        int len1=p.length();
//        for(int i=0;i<len-len1-2;i++){
//            String ret=s.substring(i,len1+i);
//            System.out.println(ret);
    }
    public static void main4(String[] args) {
        String ret="abab";
        System.out.println(ret.contains("ab"));
        System.out.println(ret.contains("ba"));
        System.out.println("ab".contains("a"));
        String c=ret.substring(0,2);
        System.out.println(c);

    }
    public static void main3(String[] args) {
        int [] arr=new int[]{1,2,3};
        int [] tmp=new int[arr.length];
    }
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int a = in.nextInt();
            int n=0;
            for(int i=2;i<a/2;i++){
                if(sushu(i)){
                    if(sushu(a-i)){
                        n=i;
                    }
                }
            }
            System.out.println(n);
            System.out.println(a-n);

        }
    }
    public static boolean sushu(int a){
        for(int i=2;i<=Math.sqrt(a);i++){
            if(a%i==0){
                return false;
            }
        }
        return true;
    }

    public static void main1(String[] args) {
        LinkedList<Integer> list=new LinkedList<>();
         list.addFirst(1);
    }
}
